package com.example.fechat.room.user

import androidx.room.*

@Dao
interface UserDao {
    @Query("SELECT * FROM user_info")
    fun queryAll(): List<UserEntity>

    @Query("SELECT * FROM user_info WHERE _id IN (:userIds)")
    fun queryAllByUserId(userIds: IntArray?): List<UserEntity>

    @Query("SELECT * FROM user_info WHERE userId LIKE :userId")
    fun findByUserId(userId: String?): UserEntity?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(userEntity: UserEntity?): Long?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertAll(userEntityList: List<UserEntity?>?): List<Long?>?

    @Update
    fun update(userEntity: UserEntity?): Int

    @Update
    fun updateAll(userEntityList: List<UserEntity?>?): Int

    @Delete
    fun delete(userEntity: UserEntity?): Int

    @Delete
    fun deleteAll(userEntityList: List<UserEntity?>?): Int
}